import React,{useEffect,useState} from 'react'
import {getServicelog} from  '@/api/service'
import { Space, Table, Tag } from 'antd';
import type { ColumnsType } from 'antd/es/table';
import {useAddkey} from '@/hooks/index'
import {initTable} from '@/hoc/index'


const columns= [
  {
    title: 'ID',
    dataIndex: 'vsid',
    key: 'vsid',
  },
  {
    title: '游客id',
    dataIndex: 'visitor_id',
    key: 'visitor_id',
  },
  {
    title: '游客名称',
    dataIndex: 'visitor_name',
    key: 'visitor_name',
  },
  {
    title: 'IP',
    dataIndex: 'visitor_ip',
    key: 'visitor_ip',
  },
  {
    title: '接待客服',
    dataIndex: 'kefu_name',
    key: 'kefu_name',
  },
  {
    title: '开始时间',
    dataIndex: 'start_date',
    key: 'start_date',
  },
  {
    title: '结束时间',
    dataIndex: 'end_date',
    key: 'end_date',
    render:(item:string)=>{
      return item?item:'无'
    }
  },

  


];




function index(props:any) {
  // const [data,setdata] = useState([])
  // useEffect(()=>{
  //   getServicelog().then((res)=>{
  //     console.log(res,'getServicelog')
  //     setdata(useAddkey(res.data))
  //   })
  // },[])
  return (
    <div>
      
        服务记录
        <Table rowKey="vsid" columns={columns} dataSource={props.data} />
    </div>
  )
}
export default initTable(getServicelog)(index)
